import { BLEND_MODES, Texture, Shader, UniformGroup,
        GraphicsGeometry, LineStyle, FillStyle, Polygon, Point, Matrix,
        State, Container, utils,} from "pixi.js";

import Mixin from './utils/Mixin.js';
import DrawBase from './DrawBase.js';

// a default shaders map used by graphics..
const DEFAULT_SHADERS = {};

const hex2rgb = utils.hex2rgb;

const {Float32Array, Uint16Array, Int32Array} = window;

const temp = new Float32Array(3);
/**
 * 图形基础类
 *
 * DrawBaseItem
 * 
 * @extends PIXI.Container
 * @class
 * @memberof Nice.DrawBase
 * @author iwangcj
 */
class DrawBaseItem extends Container {

   /**
     * @param {PIXI.GraphicsGeometry} [geometry=null] - Geometry to use, if omitted
     *        will create a new GraphicsGeometry instance.
     */
    constructor(geometry = null)
    {
        super();
        /**
         * Includes vertex positions, face indices, normals, colors, UVs, and
         * custom attributes within buffers, reducing the cost of passing all
         * this data to the GPU. Can be shared between multiple Mesh or DrawBaseItem objects.
         * @member {PIXI.GraphicsGeometry}
         * @readonly
         */
        this.geometry = geometry || new GraphicsGeometry();

        this.geometry.refCount++;

        /**
         * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
         * Can be shared between multiple DrawBaseItem objects.
         * @member {PIXI.Shader}
         */
        this.shader = null;

        /**
         * Represents the WebGL state the DrawBaseItem required to render, excludes shader and geometry. E.g.,
         * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
         * @member {PIXI.State}
         */
        this.state = State.for2d();

        /**
         * Current fill style
         *
         * @member {PIXI.FillStyle}
         * @protected
         */
        this._fillStyle = new FillStyle();

        /**
         * Current line style
         *
         * @member {PIXI.LineStyle}
         * @protected
         */
        this._lineStyle = new LineStyle();

        /**
         * Current shape transform matrix.
         *
         * @member {PIXI.Matrix}
         * @protected
         */
        this._matrix = null;

        /**
         * Current hole mode is enabled.
         *
         * @member {boolean}
         * @default false
         * @protected
         */
        this._holeMode = false;

        /**
         * Current path
         *
         * @member {PIXI.Polygon}
         * @protected
         */
        // this.currentPath = null;

        /**
         * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
         * This is useful if your graphics element does not change often, as it will speed up the rendering
         * of the object in exchange for taking up texture memory. It is also useful if you need the graphics
         * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if
         * you are constantly redrawing the graphics element.
         *
         * @name cacheAsBitmap
         * @member {boolean}
         * @memberof PIXI.DrawBaseItem#
         * @default false
         */

        /**
         * A collections of batches! These can be drawn by the renderer batch system.
         *
         * @protected
         * @member {object[]}
         */
        this.batches = [];

        /**
         * Update dirty for limiting calculating tints for batches.
         *
         * @protected
         * @member {number}
         * @default -1
         */
        this.batchTint = -1;

        /**
         * Copy of the object vertex data.
         *
         * @protected
         * @member {Float32Array}
         */
        this.vertexData = null;

        this._transformID = -1;
        this.batchDirty = -1;

        /**
         * Renderer plugin for batching
         *
         * @member {string}
         * @default 'batch'
         */
        this.pluginName = 'batch';

        // Set default
        this.tint = 0xFFFFFF;
        this.blendMode = BLEND_MODES.NORMAL;
    }

    // /**
    //  * Creates a new DrawBaseItem object with the same values as this one.
    //  * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)
    //  *
    //  * @return {PIXI.DrawBaseItem} A clone of the graphics object
    //  */
    // clone()
    // {
    //     this.finishPoly();

    //     return new DrawBaseItem(this.geometry);
    // }

    /**
     * The blend mode to be applied to the graphic shape. Apply a value of
     * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
     *
     * @member {number}
     * @default PIXI.BLEND_MODES.NORMAL;
     * @see PIXI.BLEND_MODES
     */
    set blendMode(value)
    {
        this.state.blendMode = value;
    }

    get blendMode()
    {
        return this.state.blendMode;
    }

    /**
     * The tint applied to the graphic shape. This is a hex value. A value of
     * 0xFFFFFF will remove any tint effect.
     *
     * @member {number}
     * @default 0xFFFFFF
     */
    get tint()
    {
        return this._tint;
    }
    set tint(value)
    {
        this._tint = value;
    }

    /**
     * The current fill style.
     *
     * @member {PIXI.FillStyle}
     * @readonly
     */
    get fill()
    {
        return this._fillStyle;
    }

    /**
     * The current line style.
     *
     * @member {PIXI.LineStyle}
     * @readonly
     */
    get line()
    {
        return this._lineStyle;
    }

    /**
     * Specifies the line style used for subsequent calls to DrawBaseItem methods such as the lineTo()
     * method or the drawCircle() method.
     *
     * @param {number} [width=0] - width of the line to draw, will update the objects stored style
     * @param {number} [color=0] - color of the line to draw, will update the objects stored style
     * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
     * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
     * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
     * @return {Nice.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    lineStyle(width = 0, color = 0, alpha = 1, alignment = 0.5, native = false)
    {
        this.lineTextureStyle(width, Texture.WHITE, color, alpha, null, alignment, native);

        return this;
    }

    /**
     * Like line style but support texture for line fill.
     *
     * @param {number} [width=0] - width of the line to draw, will update the objects stored style
     * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to use
     * @param {number} [color=0] - color of the line to draw, will update the objects stored style
     * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
     * @param {PIXI.Matrix} [matrix=null] Texture matrix to transform texture
     * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
     * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
     * @return {Nice.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    lineTextureStyle(width = 0, texture = Texture.WHITE, color = 0xFFFFFF, alpha = 1,
        matrix = null, alignment = 0.5, native = false)
    {
        // if (this.currentPath)
        // {
        //     this.startPoly();
        // }

        const visible = width > 0 && alpha > 0;

        if (!visible)
        {
            this._lineStyle.reset();
        }
        else
        {
            if (matrix)
            {
                matrix = matrix.clone();
                matrix.invert();
            }

            Object.assign(this._lineStyle, {
                color,
                width,
                alpha,
                matrix,
                texture,
                alignment,
                native,
                visible,
            });
        }

        return this;
    }
    
    /**
     * Specifies a simple one-color fill that subsequent calls to other DrawBaseItem methods
     * (such as lineTo() or drawCircle()) use when drawing.
     *
     * @param {number} [color=0] - the color of the fill
     * @param {number} [alpha=1] - the alpha of the fill
     * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    beginFill(color = 0, alpha = 1)
    {
        return this.beginTextureFill(Texture.WHITE, color, alpha);
    }

    /**
     * Begin the texture fill
     *
     * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to fill
     * @param {number} [color=0xffffff] - Background to fill behind texture
     * @param {number} [alpha=1] - Alpha of fill
     * @param {PIXI.Matrix} [matrix=null] - Transform matrix
     * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    beginTextureFill(texture = Texture.WHITE, color = 0xFFFFFF, alpha = 1, matrix = null)
    {
        // if (this.currentPath)
        // {
        //     this.startPoly();
        // }

        const visible = alpha > 0;

        if (!visible)
        {
            this._fillStyle.reset();
        }
        else
        {
            if (matrix)
            {
                matrix = matrix.clone();
                matrix.invert();
            }

            Object.assign(this._fillStyle, {
                color,
                alpha,
                texture,
                matrix,
                visible,
            });
        }

        return this;
    }

    /**
     * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
     *
     * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    endFill()
    {
        // this.finishPoly();

        // this._fillStyle.reset();

        return this;
    }

    /**
     * Draw any shape.
     *
     * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw
     * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    drawShape(shape)
    {
        this.geometry.clear();

        if (!this._holeMode)
        {
            this.geometry.drawShape(
                shape,
                this._fillStyle.clone(),
                this._lineStyle.clone(),
                this._matrix
            );
        }
        else
        {
            this.geometry.drawHole(shape, this._matrix);
        }

        return this;
    }

    // /**
    //  * Draw a star shape with an arbitrary number of points.
    //  *
    //  * @param {number} x - Center X position of the star
    //  * @param {number} y - Center Y position of the star
    //  * @param {number} points - The number of points of the star, must be > 1
    //  * @param {number} radius - The outer radius of the star
    //  * @param {number} [innerRadius] - The inner radius between points, default half `radius`
    //  * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical
    //  * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
    //  */
    // drawStar(x, y, points, radius, innerRadius, rotation = 0)
    // {
    //     return this.drawPolygon(new Star(x, y, points, radius, innerRadius, rotation));
    // }

    /**
     * Clears the graphics that were drawn to this DrawBaseItem object, and resets fill and line style settings.
     *
     * @return {PIXI.DrawBaseItem} This DrawBaseItem object. Good for chaining method calls
     */
    clear()
    {
        this.geometry.clear();
        this._lineStyle.reset();
        this._fillStyle.reset();

        this._matrix = null;
        this._holeMode = false;
        // this.currentPath = null;

        return this;
    }

    /**
     * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and
     * masked with gl.scissor.
     *
     * @returns {boolean} True if only 1 rect.
     */
    isFastRect()
    {
        // will fix this!
        return false;
        // this.graphicsData.length === 1
        //  && this.graphicsData[0].shape.type === SHAPES.RECT
        // && !this.graphicsData[0].lineWidth;
    }

    /**
     * Renders the object using the WebGL renderer
     *
     * @protected
     * @param {PIXI.Renderer} renderer - The renderer
     */
    _render(renderer)
    {
        // this.finishPoly();

        const geometry = this.geometry;

        // batch part..
        // batch it!
        geometry.updateBatches();

        if (geometry.batchable)
        {
            if (this.batchDirty !== geometry.batchDirty)
            {
                this._populateBatches();
            }

            this._renderBatched(renderer);
        }
        else
        {
            // no batching...
            renderer.batch.flush();

            this._renderDirect(renderer);
        }
    }

    /**
     * Populating batches for rendering
     *
     * @protected
     */
    _populateBatches()
    {
        const geometry = this.geometry;
        const blendMode = this.blendMode;

        this.batches = [];
        this.batchTint = -1;
        this._transformID = -1;
        this.batchDirty = geometry.batchDirty;

        this.vertexData = new Float32Array(geometry.points);

        for (let i = 0, l = geometry.batches.length; i < l; i++)
        {
            const gI = geometry.batches[i];
            const color = gI.style.color;
            const vertexData = new Float32Array(this.vertexData.buffer,
                gI.attribStart * 4 * 2,
                gI.attribSize * 2);

            const uvs = new Float32Array(geometry.uvsFloat32.buffer,
                gI.attribStart * 4 * 2,
                gI.attribSize * 2);

            const indices = new Uint16Array(geometry.indicesUint16.buffer,
                gI.start * 2,
                gI.size);

            const batch = {
                vertexData,
                blendMode,
                indices,
                uvs,
                _batchRGB: hex2rgb(color),
                _tintRGB: color,
                _texture: gI.style.texture,
                alpha: gI.style.alpha,
                worldAlpha: 1 };

            this.batches[i] = batch;
        }
    }

    /**
     * Renders the batches using the BathedRenderer plugin
     *
     * @protected
     * @param {PIXI.Renderer} renderer - The renderer
     */
    _renderBatched(renderer)
    {
        if (!this.batches.length)
        {
            return;
        }

        renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);

        this.calculateVertices();
        this.calculateTints();

        for (let i = 0, l = this.batches.length; i < l; i++)
        {
            const batch = this.batches[i];

            batch.worldAlpha = this.worldAlpha * batch.alpha;

            renderer.plugins[this.pluginName].render(batch);
        }
    }

    /**
     * Renders the graphics direct
     *
     * @protected
     * @param {PIXI.Renderer} renderer - The renderer
     */
    _renderDirect(renderer)
    {
        const shader = this._resolveDirectShader(renderer);

        const geometry = this.geometry;
        const tint = this.tint;
        const worldAlpha = this.worldAlpha;
        const uniforms = shader.uniforms;
        const drawCalls = geometry.drawCalls;

        // lets set the transfomr
        uniforms.translationMatrix = this.transform.worldTransform;

        // and then lets set the tint..
        uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;
        uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;
        uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;
        uniforms.tint[3] = worldAlpha;

        // the first draw call, we can set the uniforms of the shader directly here.

        // this means that we can tack advantage of the sync function of pixi!
        // bind and sync uniforms..
        // there is a way to optimise this..
        renderer.shader.bind(shader);
        renderer.geometry.bind(geometry, shader);

        // set state..
        renderer.state.set(this.state);

        // then render the rest of them...
        for (let i = 0, l = drawCalls.length; i < l; i++)
        {
            this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);
        }
    }

    /**
     * Renders specific DrawCall
     *
     * @param {PIXI.Renderer} renderer
     * @param {PIXI.BatchDrawCall} drawCall
     */
    _renderDrawCallDirect(renderer, drawCall)
    {
        const groupTextureCount = drawCall.textureCount;

        for (let j = 0; j < groupTextureCount; j++)
        {
            renderer.texture.bind(drawCall.textures[j], j);
        }

        renderer.geometry.draw(drawCall.type, drawCall.size, drawCall.start);
    }

    /**
     * Resolves shader for direct rendering
     *
     * @protected
     * @param {PIXI.Renderer} renderer - The renderer
     */
    _resolveDirectShader(renderer)
    {
        let shader = this.shader;

        const pluginName = this.pluginName;

        if (!shader)
        {
            // if there is no shader here, we can use the default shader.
            // and that only gets created if we actually need it..
            // but may be more than one plugins for graphics
            if (!DEFAULT_SHADERS[pluginName])
            {
                const sampleValues = new Int32Array(16);

                for (let i = 0; i < 16; i++)
                {
                    sampleValues[i] = i;
                }

                const uniforms = {
                    tint: new Float32Array([1, 1, 1, 1]),
                    translationMatrix: new Matrix(),
                    default: UniformGroup.from({ uSamplers: sampleValues }, true),
                };

                const program = renderer.plugins[pluginName]._shader.program;

                DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);
            }

            shader = DEFAULT_SHADERS[pluginName];
        }

        return shader;
    }

    /**
     * Retrieves the bounds of the graphic shape as a rectangle object
     *
     * @protected
     */
    _calculateBounds()
    {
        // this.finishPoly();
        const lb = this.geometry.bounds;

        this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);
    }

    /**
     * Tests if a point is inside this graphics object
     *
     * @param {PIXI.Point} point - the point to test
     * @return {boolean} the result of the test
     */
    containsPoint(point)
    {
        this.worldTransform.applyInverse(point, DrawBaseItem._TEMP_POINT);

        return this.geometry.containsPoint(DrawBaseItem._TEMP_POINT);
    }

    /**
     * Recalcuate the tint by applying tin to batches using DrawBaseItem tint.
     * @protected
     */
    calculateTints()
    {
        if (this.batchTint !== this.tint)
        {
            this.batchTint = this.tint;

            const tintRGB = hex2rgb(this.tint, temp);

            for (let i = 0; i < this.batches.length; i++)
            {
                const batch = this.batches[i];

                const batchTint = batch._batchRGB;

                const r = (tintRGB[0] * batchTint[0]) * 255;
                const g = (tintRGB[1] * batchTint[1]) * 255;
                const b = (tintRGB[2] * batchTint[2]) * 255;

                // TODO Ivan, can this be done in one go?
                const color = (r << 16) + (g << 8) + (b | 0);

                batch._tintRGB = (color >> 16)
                        + (color & 0xff00)
                        + ((color & 0xff) << 16);
            }
        }
    }

    /**
     * If there's a transform update or a change to the shape of the
     * geometry, recaculate the vertices.
     * @protected
     */
    calculateVertices()
    {
        if (this._transformID === this.transform._worldID)
        {
            return;
        }

        this._transformID = this.transform._worldID;

        const wt = this.transform.worldTransform;
        const a = wt.a;
        const b = wt.b;
        const c = wt.c;
        const d = wt.d;
        const tx = wt.tx;
        const ty = wt.ty;

        const data = this.geometry.points;// batch.vertexDataOriginal;
        const vertexData = this.vertexData;

        let count = 0;

        for (let i = 0; i < data.length; i += 2)
        {
            const x = data[i];
            const y = data[i + 1];

            vertexData[count++] = (a * x) + (c * y) + tx;
            vertexData[count++] = (d * y) + (b * x) + ty;
        }
    }

    /**
     * Apply a matrix to the positional data.
     *
     * @param {PIXI.Matrix} matrix - Matrix to use for transform current shape.
     * @return {PIXI.DrawBaseItem} Returns itself.
     */
    setMatrix(matrix)
    {
        this._matrix = matrix;

        return this;
    }

    /**
     * Begin adding holes to the last draw shape
     * IMPORTANT: holes must be fully inside a shape to work
     * Also weirdness ensues if holes overlap!
     * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,
     * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.
     * @return {PIXI.DrawBaseItem} Returns itself.
     */
    beginHole()
    {
        // this.finishPoly();
        this._holeMode = true;

        return this;
    }

    /**
     * End adding holes to the last draw shape
     * @return {PIXI.DrawBaseItem} Returns itself.
     */
    endHole()
    {
        // this.finishPoly();
        this._holeMode = false;

        return this;
    }

    /**
     * Destroys the DrawBaseItem object.
     *
     * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
     *  options have been set to that value
     * @param {boolean} [options.children=false] - if set to true, all the children will have
     *  their destroy method called as well. 'options' will be passed on to those calls.
     * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
     *  Should it destroy the texture of the child sprite
     * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
     *  Should it destroy the base texture of the child sprite
     */
    destroy(options)
    {
        super.destroy(options);

        this.geometry.refCount--;
        if (this.geometry.refCount === 0)
        {
            this.geometry.dispose();
        }

        this._matrix = null;
        // this.currentPath = null;
        this._lineStyle.destroy();
        this._lineStyle = null;
        this._fillStyle.destroy();
        this._fillStyle = null;
        this.geometry = null;
        this.shader = null;
        this.vertexData = null;
        this.batches.length = 0;
        this.batches = null;

        super.destroy(options);
    }


    /**
     * line style setting
     */
    set lineWidth(width) {
        const {color, alpha, matrix, texture, alignment, native, visible} = this._lineStyle;
        Object.assign(this._lineStyle, {
            color,
            width,
            alpha,
            matrix,
            texture,
            alignment,
            native,
            visible,
        });
    }

    get lineWidth() {
        const {width} = this._lineStyle;
        return width;
    }

    set lineColor(color) {
        const {width, alpha, matrix, texture, alignment, native, visible} = this._lineStyle;
        Object.assign(this._lineStyle, {
            color,
            width,
            alpha,
            matrix,
            texture,
            alignment,
            native,
            visible,
        });
    }

    get lineColor() {
        const {color} = this._lineStyle;
        return color;
    }

    set lineAlpha(alpha) {
        const {width, color, matrix, texture, alignment, native, visible} = this._lineStyle;
        Object.assign(this._lineStyle, {
            color,
            width,
            alpha,
            matrix,
            texture,
            alignment,
            native,
            visible,
        });
    }

    get lineAlpha() {
        const {alpha} = this._lineStyle;
        return alpha;
    }

    set lineTexture(texture) {
        const {width, color, matrix, alpha, alignment, native, visible} = this._lineStyle;
        Object.assign(this._lineStyle, {
            color,
            width,
            alpha,
            matrix,
            texture,
            alignment,
            native,
            visible,
        });
    }

    get lineTexture() {
        const {texture} = this._lineStyle;
        return texture;
    }

    /**
     * fill stype setting
     */
    set fillColor(color) {
        const {texture, alpha, matrix, visible} = this._fillStyle;
        Object.assign(this._fillStyle, {color, texture, matrix, visible, alpha});
    }

    get fillColor() {
        const {color} = this._fillStyle;
        return color;
    }

    set fillAlpha(alpha) {
        const {color, texture, matrix, visible} = this._fillStyle;
        Object.assign(this._fillStyle, {color, texture, matrix, visible, alpha});
    }

    get fillAlpha() {
        const {alpha} = this._fillStyle;
        return alpha;
    }

    set fillTexture(texture) {
        const {color, alpha, matrix, visible} = this._fillStyle;
        Object.assign(this._fillStyle, {color, texture, matrix, visible, alpha});
    }

    get fillTexture() {
        const {texture} = this._fillStyle;
        return texture;
    }

    _getAttrStyle(key) {

        let result = undefined; //未定义
        if ('fill' == key) {
            result = this.fillColor;
        } 
        else if ('fill-opacity' === key) {
            result = this.fillAlpha;
        }
        else if ('stroke' === key) {
            result = this.lineColor;
        }
        else if ('stroke-width' === key) {
            result = this.lineWidth;
        }
        else if ('stroke-opacity' === key) {
            result = this.lineAlpha;
        }
        else if ('visible' === key) {
            result = this.visible;
        }

        return result;
    }

    _setAtterStyle(key, value=undefined) {
        let isOk = true;
        if ('fill' == key) {
            this.fillColor = value;
        } 
        else if ('fill-opacity' === key) {
            this.fillAlpha = value;
        }
        else if ('stroke' === key) {
            this.lineColor = value;
        }
        else if ('stroke-width' === key) {
            this.lineWidth = value;
        }
        else if ('stroke-opacity' === key) {
            this.lineAlpha = value;
        }
        else if ('visible' === key) {
            this.visible = value;
        }
        else {
            isOk = false;
        }
        return isOk;
    }

    /**
     * @param {*} key 
     * @param {*} value 
     */
    attrStyle(key, value=undefined) {
        if (undefined != value) {
            return this._setAtterStyle(key, value)
        }
        else {
            return this._getAttrStyle(key);
        }
    }
}


/**
 * Temporary point to use for containsPoint
 *
 * @static
 * @private
 * @member {PIXI.Point}
 */
DrawBaseItem._TEMP_POINT = new Point();

export default Mixin(DrawBaseItem, DrawBase);